//========encoding:utf-8=========
/*
 * @describe:  三目运算符
 * @author:mhao
 * @copyright:chinasoft.cn
 * @date:2020年3月31日   下午11:12:44
 */
package edu.chinasoft.service;

import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import edu.chinasoft.domain.Idcard;
import edu.chinasoft.domain.Item;
import edu.chinasoft.domain.PageUnitForIdcard;
import edu.chinasoft.mapper.ItemMapper;

@Service("itemServiceImp")
public class ItemServiceImp implements ItemService{
	@Autowired
	@Qualifier("itemMapper")
	private ItemMapper itemMapper;
    private Logger logger = LoggerFactory.getLogger(ItemServiceImp.class);
    @Transactional(readOnly=false,propagation=Propagation.REQUIRED)
    @Override
    public boolean insertItem(Item item){
    	logger.info("ItemServiceImp>>>insertItem start ……");
    	boolean result_item = itemMapper.insertItem(item);
    	boolean result_application = itemMapper.updateApplicateState(item);
    	logger.info("ItemServiceImp>>>insertItem end ……");
		return result_item&&result_application;
    }


}
